#import "CinemasViewController.h"
#import "CinemasData.h"
#import "Cinema.h"
#import "ProgramViewController.h"


@interface CinemasViewController ()

@property (weak, nonatomic) IBOutlet UILabel *secondMovieAddress;
@property (weak, nonatomic) IBOutlet UIImageView *secondImage;


@property (weak, nonatomic) IBOutlet UIImageView *thirdImage;


@property (weak, nonatomic) IBOutlet UILabel *firstCinemaAddress;
@property (weak, nonatomic) IBOutlet UILabel *firstCinemaWorkingTime;
@property (weak, nonatomic) IBOutlet UIImageView *firstImage;

@end

@implementation CinemasViewController

- (IBAction)programForCinema:(id)sender {
    ProgramViewController* vc = [[ProgramViewController alloc] initWithNibName:nil bundle:nil];
    vc.cinema = [CinemasData sharedCinemasData].allCinemas[[sender tag]];
    [self.navigationController pushViewController:vc animated:YES];
}


-(void)viewDidLoad {
    [super viewDidLoad];
    
    Cinema* firstCinema = [CinemasData sharedCinemasData].allCinemas[0];
    Cinema* secondCinema = [CinemasData sharedCinemasData].allCinemas[1];
    
    self.firstCinemaAddress.text = firstCinema.address;
    self.firstCinemaWorkingTime.text = firstCinema.workingTime;
    self.firstImage.image = [UIImage imageNamed:firstCinema.image];
    
    self.secondMovieAddress.text = secondCinema.address;
    self.secondImage.image = [UIImage imageNamed:secondCinema.image];
    
}

-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBarHidden = YES;
    self.navigationController.navigationBar.hidden = YES;
}


@end
